//远程调用接口

var iManager = function () {
	return {
        login: function (param){
	    	param.uri = projectName + "/admin/login";
	    	goSend(param);
	    },
		addMessage: function (param){
			param.uri = projectName + "/msg/add";
			goSend(param);
		},
		deleteMessage: function (param){
			param.uri = projectName + "/msg/delete";
			goSend(param);
		},
		addQuestion: function (param){
			param.uri = projectName + "/question/add";
			goSend(param);
		},
		updateTaskActiveNum: function (param){
			param.uri = projectName + "/task/updateActiveNum";
			goSend(param);
		},
	};
}();

var goSend = function(param){
	sendRequest.withOutToken({
		url:param.uri,
		data:param.data || {},
		callback:param.callback
	})
}
//错误码对应
var errorCode = (function(){
	var hash={
		'100001':'用户名为空',
		'100002':'用户密码为空',
		'100003':'用户名或密码错误',
		'-1000':'系统错误',
		'-2000':'无效会话',
		'-3000':'权限不足',
		'-4000':'参数为空',
		'-9000':'黑名单过滤用户',
	};
	return{
		getErrorDescript:function(option){
    		for (var j in hash){
    			option.descript=hash[option.code];
    		}
    		return option.descript
		}
	}
}());
